/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jaotwinker;
import java.util.Comparator;
/**
 *
 * @author Grayson
 */
public class ItemCompare implements Comparator<Item> {
    
    public String skill;
    public boolean reverse;
    
    public ItemCompare(boolean reverse) {
        this.reverse=reverse;
    }
    
    public int compare(Item item1, Item item2) {
        int i1v = 0, i2v = 0;
        if(skill=="") { System.out.println("Woops"); return 0; }
        i1v = item1.getSkill(skill);
        i2v = item2.getSkill(skill);
        if(reverse) { return i1v-i2v; }
        else return i2v-i1v;
    } 
}
